#include <iostream>
#include <chrono>
#include <random>
#include <ctime>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <string>
#include <queue>
#include <stack>
#include <deque>
#include <vector>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <functional>
#define VNAME(name) (#name)
#define debug(x) {int debugx = x; std::cout << " (" << VNAME(x) << ": " << (debugx) << ")\n";}
#define F_(n) cout << fixed << setprecision(n)
#ifndef ONLINE_JUDGE
#else
	#define endl '\n'
#endif
using namespace std;
typedef long long LL;
typedef pair<int, int> PII;
const int N = 3e5 + 5;
const int MOD = 1e9 + 7;
mt19937 rng((int)chrono::steady_clock::now().time_since_epoch().count());
bool _OJ_Flag = true;
static int __ = []() {
    ios::sync_with_stdio(false);
    cin.tie(0), cout.tie(0);
    return 0;
}();//*/
bool su[N];
int arr[N];
void solve(int n, char c, string &s) {
    int len = s.length();
    int flag = -1;
    for (int i = 0; i < len; ++ i) 
        if (s[i] != c) {
            flag = i;
            break;
        }
    if (flag == -1) {
        cout << 0 << endl;
        return ;
    }
    len >>= 1;
    for (int i = s.length() - 1; i >= len; -- i) {
        if (s[i] == c) {
            cout << 1 << endl << i + 1 << endl;
            return ;
        }
    }
    cout << 2 << endl << n << " " << n - 1 << endl;
}
signed main() {
    #ifndef ONLINE_JUDGE
		_OJ_Flag = false; //freopen("C:\\Users\\lenovo\\Desktop\\in.in", "r", stdin);
	#endif
    int t = 1;
    cin >> t;
    while (t --) {
        int n; char c; string s;
        cin >> n >> c;
        cin >> s;
        solve(n, c, s);
        //debug(solve(n));
    }
    #ifndef ONLINE_JUDGE
		system("pause");
	#endif
    return 0;
}